package top.wintp.juhedatademo.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;


import java.util.List;

import top.wintp.juhedatademo.fragment.BaseFragment;


/**
 * Created by Administrator on 2017/9/5 0005.
 * email: apk2sf@163.com
 * QQ：337081267
 */

public class HomePagerAdapter extends FragmentStatePagerAdapter {
    private final List<BaseFragment> baseFragmentList;

    public HomePagerAdapter(FragmentManager fm, List<BaseFragment> baseFragmentList) {
        super(fm);
        this.baseFragmentList = baseFragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return baseFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return baseFragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {

        return baseFragmentList.get(position).getTitle();
    }
}
